package com.sunducation.co.cw;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

/**
 * @description: 正规则表达式
 * @author:chenwenbiao
 * @createTime:2019/7/8 19:54
 * @Version：1.0
 **/
public class RegularExpressionTest {

    /**
     * 结果是：
     * [a, |, b, c, d, |, e, d, f]
     */
    public static void splitTest1(String s){
        String[] sList = s.split("|");

        System.out.println(Arrays.asList(sList).toString());
    }


    /**
     * 结果是：
     * [a, bcd, edf]
     */
    public static void splitTest2(String s){
        String[] sList = s.split("\\|");

        System.out.println(Arrays.asList(sList).toString());
    }

    public static void main(String[] argv){
        String s = "a|bcd|edf";
        splitTest1(s);
        splitTest2(s);
    }

}
